play makAll work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All
HBAM2016AUG95
Pro 3.0
All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dullCopyright 1984-1996 Claris Corporation
and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy.
HBAM3016AUG95@
Pro 3.0F!
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
January
February
March
April
August
September
October
November
December
1st Quarter
2nd Quarter
3rd Quarter
4th Quarter
dTfUbS
9/1/96
ABOUT
APPLICATION
COMMENTS
COPY CHECKBOX
CREATION DATE
CURRENT RECORD
DESCRIPTION
FINDER PICTURE
FOUND RECORDS
LAYOUT ID
MARKED
MODIFICATION DATE
READ ME BUTTON
READ ME ICONS
READ ME TEXT
SCRIPT AUTHOR
SCRIPT CODE
SCRIPT NAME
SCRIPT TYPE
TOTAL RECORDS
DescriptionB
Script CodeB
ApplicationB
No Description
Description
@7A List View
Read Me
Splash Screen
No DescriptionB
Script NameB
Script AuthorB
Creation DateB
Modification DateB
Total RecordsB
Found RecordsB
Current RecordB
Script TypeB
Read Me IconsB
Read Me ButtonB
= ""
Read Me TextB
CommentsB
Finder PictureB
Copy CheckboxB
AboutB
A Layout IDB
MarkedB
About this product...
(click in this area to read more.)
This database is a shell that serves as a repository for all of your AppleScript code and information.
more...
Through a collaborative effort between yourself and the AppleScript community you can share your scripts with others as well as get scripts from other scripters. Under the Script Menu you will find both an Import and Export menu item for trading scripts using this database.
While in its infancy, there are many uses for t
his model. To gain access to a large collection of AppleScript scripts there are many sources that you can check out.
<book, web site & scripting mailing list information pending>
If you have comments or suggestions for this growing database project then please send email to Matt Petrowsky <macventure@aol.com>. Please do not send requests for information about solving AppleScript problems.
DescriptionB
NextD
PrevE
ListF
FindH
ReadMeJ
Description...L9Total Scripts = <<
ABAN>> / Script <<
ABAP>> of <<
ABAO>>
A List ViewB
Application:N
Author:P
Created:T Modified:Y
NextZ
Prev[
List]9Total Scripts = <<
ABAN>> / Script <<
ABAP>> of <<
ABAO>>^
Findh
Type:k
ReadMem Comments:p
Copy script?q
Description:t
Marked
Read MeB
Script NameB
ApplicationC
Script AuthorD
DescriptionI
ListK
List View:M
Script NameN
ApplicationR9Created by <<
ABAH>> on <<
ABAI>> - Modified on <<
ABAK>>T
DescriptionU
NextV
PrevW
Find[
ReadMe]
Sort^9Total Scripts = <<
ABAN>> / Script <<
ABAP>> of <<
ABAO>>_
Splash ScreenB
ReturnFdIf picture exists, select it and drag to the Finder to create a picture clipping that can be viewed.I
Read Me Text Information:
KA)Script for moving Emailer messages to FMP
on run
local myFolder
set myFolder to choose folder with prompt "Choose the folder to import into FMPro"
on error -- e.g. user cancelled
return
end try
walkfolder(myFolder)
set the text item delimiters to {""}
end run
-- Execute the following when a file or folder is dropped on the icon
on open (myFiles) -- myFiles contains the list of items dragged to the droplet
if ((length of myFiles) > 100) then
display dialog
"Please only drag groups of 100 files or folders
AppleScript
and Script Editor are trademarks of Apple Computer Inc. AppleScript Database is
1996 by Matt Petrowsky developed using FileMaker
Pro by Claris Corp. All rights reserved foreign and domestic.D
Version 1.0
AppleScript
and Script Editor are trademarks of Apple Computer Inc. AppleScript Database is
1996 by Matt Petrowsky developed using FileMaker
Pro by Claris Corp. All rights reserved foreign and domestic.D
Version 1.0
using FileMaker
Pro by Claris Corp. All rights reserved foreign and domestic.
Useful when embedded into FileMaker Pro. It takes advantage of the OSAX Jon
s Commands which will allow FileMaker Pro to work with the clipboard.
tell application "Finder"
set OSAX to choose file with prompt "Please locate Jon's Commands..." of type {"osax"}
move file OSAX to folder "Scripting Additions" of folder "Extensions" of folder
"System Folder" of startup disk with replacing
end tell
FileMaker ProF
Install Jon
s CommandsG#Matt Petrowsky <macventure@aol.com>H
6/14/96J
6/15/96P
ScriptY
at a time. " buttons {"OK"} default button "OK" with icon stop
else
-- Loop through each item.
repeat with myFile in myFiles -- myFile contains the path to the file
-- this next step is slow ..."info for myFile" calculates the size of the folder :-(
-- could try using on error handler and test against a field only folders have
if (folder of (info for myFile)) then
walkfolder(myFile as alias)
else
tell me to ParseFile(alias ((folder1 as text) & x))
if my isGood
then tell me to addToFM()
end if
end repeat
end if
end open
on walkfolder(folder1)
tell application "Finder"
set Folder1Contents to list folder folder1
repeat with x in Folder1Contents
if kind of alias ((folder1 as text) & x) is "folder" then
tell me to walkfolder(alias ((folder1 as text) & x))
else
tell me to ParseFile(alias ((folder1 as text) & x))
if my isGood then tell me to addToFM()
end if
end repeat
end tell
end walkfolder
global isGood
global my
Folder -- all this is because i'm lazy
global mySubject
global mySent
global myReceived
global myFrom
global myReplyTo
global myTo
global myCC
global myEnclosure
global myMessage
on ParseFile(myFile) -- Parse a file for the sender's information
local myFile
local myLine
--Subject: TEST
--Sent: 04/01 5:19 PM
--Received: 04/01 6:20 PM
--From: Eric Scheid, ironclad@planet.net.au
--Reply-To: Eric Scheid, ironclad@planet.net.au
--To: Eric Scheid, ir
onclad@planet.net.au
--CC: Eric Scheid, ironclad@planet.net.au
-- Eric Scheid, ironclad@planet.net.au
--Enclosure: hutch #2 folder
--this is the message
. it is always preceded by a blank line.
set AppleScript's text item delimiters to {":"}
set myFolder to text item -2 of (myFile as text)
set AppleScript's text item delimiters to {""}
set myReplyTo to {}
set myTo to {}
set myCC to {}
set myEnclosure to {}
set isGood to false
-- Get the file type
for the file and make sure it is FCIM (Filing Cabinet Incoming)
if ((file type of (info for myFile)) = "FCIM") then
open for access myFile
try
set mySubject to characters 14 thru -1 of (read myFile until return) as text -- Subject:
set mySent to characters 14 thru -1 of (read myFile until return) as text -- Sent:
set myReceived to characters 14 thru -1 of (read myFile until return) as text -- Received:
set myFrom to characters 14 thru -1 of (read myFile until return) as t
ext -- From:
-- following can be zero or more lines for headers {"To:" "CC:" "Enclosure:"}
set myLine to read myFile until return
set lineGroup to "unknown"
repeat while myLine is not return -- read remaining headers until the blank line.
if word 1 of myLine is in {"To", "CC", "Enclosure", "Reply-To"} then
set lineGroup to word 1 of myLine
end if
if lineGroup is "To" then
set myLine to characters 14 thru -1 of myLine as text
set myTo to myTo &
{myLine}
else if lineGroup is "Reply-To" then
set myLine to characters 14 thru -1 of myLine as text
set myReplyTo to myReplyTo & {myLine}
else if lineGroup is "CC" then
set myLine to characters 14 thru -1 of myLine as text
set myCC to myCC & {myLine}
else if lineGroup is "Enclosure" then
if word 1 of myLine is not "Enclosure" then
set myLine to characters 14 thru -1 of myLine as text
end if
set myEnclosure to myEnclosure & {myLine}
end if
set myLine to read myFile until return
end repeat
set myMessage to read myFile to get eof myFile
if the length of myMessage > 0 then -- remove leading blank lines
set myMessage to paragraphs of myMessage
repeat while (item 1 of myMessage) is ""
set myMessage to items 2 thru -1 of myMessage
end repeat
set AppleScript's text item delimiters to return -- reassemble as paragraphs
set myMessage to myMessage as text
set AppleScript's text item
delimiters to ""
end if
set isGood to true
close access myFile
on error
close access myFile
end try
end if
return isGood
end ParseFile
on addToFM()
-- convert message into format acceptable to filemaker
set AppleScript's text item delimiters to ASCII character 11 -- reassemble as paragraphs
set mySubject to mySubject as text
set mySent to mySent as text
set myReceived to myReceived as text
set myFrom to myFrom as text
set myTo to myTo as text
set myCC to myCC as
text
set myEnclosure to myEnclosure as text
set myMessage to paragraphs of myMessage as text
set AppleScript's text item delimiters to ""
tell application "FileMaker Pro"
create new record
show last record
set cell "folder" to myFolder
set cell "subject" to mySubject
set cell "sent" to mySent
set cell "received" to myReceived
set cell "from" to myFrom
set cell "to" to myTo
set cell "cc" to myCC
set cell "enclosure" to myEnclosure
set cell "message" to myMessage
end tell
return ""
end addToFM
FileMaker ProF
Emailer to FileMaker ProG
Eric Scheid
6/14/96J
6/15/96P
Droplet
ainformation
about
database
bgetting
scripts
email
blaster
emailer
filemaker
fmpro
applescript
syntax
filemaker
window
rects
guy's
munger
ss2.1
install
jon's
commands
single
emailer
filemaker
Splash Screen
About...
Activate Script Editor
Enter Read Me Text
Show Description
Hide Description
View List
Sort by Script Name
Sort by Application
ReadMe Button
Return Button
Export Scripts
Import Scripts
Closing Script
This script is used to get the dimensions of a FileMaker window so that another window can be centered within it. This script uses an applications called Display Window
tell application "FileMaker Pro"
set winWidth to 300 -- the width setting of the display window
set winHeight to 100 -- the height setting of the display window
set rects to get bounds of window 1 of database "FileMaker Database"
set lSide to item 1 of rects
set tSide to item 2 of rects
set rSide to item 3 of rects
set bSide to item 4 of rects
-- need to find out how to get the absolute value of
-- a particular rects value. Reason being that a window
-- could be in a second scree
n and have negative values
set tWidth to (((rSide - lSide) - 20) div 2) - (winWidth div 2) -- the minus 20 accounts for the scroll bar
set tHeight to (((bSide - tSide) - 39) div 2) - (winHeight div 2) -- the minus 39 accounts for the title bar and scroll bar
set xcoord to tSide + tHeight
set ycoord to lSide + tWidth
activate
end tell
tell application "Window for Script"
activate
event sysodwas
"Centered" given font:"helvetica",
class size
:14,
class whig
:winHeight,
class widtCY
:winWidth,
class wilo
:{ycoord, xcoord}
bring to front
end tell
{xcoord, ycoord}
rects
FileMaker ProF
Get FileMaker Window RectsG
Matt PetrowskyH
6/14/96J
6/15/96P
Script
fA0Useful for learning FileMaker AppleScript Syntax
tell application "FileMaker Pro"
--OPEN EXAMPLES
open file ("hard disk:outer folder:inner folder:file name")
--WHOSE EXAMPLES
get data (every record whose first cell = 1)
every record whose cell "a" = 1 and cell 2 contains "cat"
show (every record whose first cell = "test")
duplicate (every record whose first cell = "test")
delete (middle record whose first cell = "test")
--SHOW EXAMPLES
show window "Test1"
show database 2
show document "Test1"
show layout 2
show layout 2
of window 2
show every record
--SET EXAMPLES
set data first record to "a b"
set data record 2 to {"a", "b"}
set data record 3 of window 2 to {"aa", "bb"}
set data record 4 of window 2 to "aaa bbbb"
set data cell 2 to "ccc"
set data field 1 to "replaced"
set data field "c" of database "Test1" to "munged"
--GET EXAMPLES
get data first cell
get data last cell
cells 1 thru 5
get data every cell
record 2
get data middle record
records 1 thru 4
every record
first cell of
window 2
get data last cell of database 2
cells 1 thru 5 of document 2
every cell of window "Test1"
record 2 of database "Test1"
middle record of last window
records 1 thru 4 of last document
every record of last database
--EXISTS EXAMPLES
exists first window
exists cell 67
exists record 10
exists FileMaker script "a"
exists first menu item of menu "external"
--DO MENU EXAMPLES
do script first FileMaker script
do script FileMaker script "a"
--SORT EXAMPLES
sort firs
t layout of window 2 by field 2 of window 2
sort first database
sort first document by {field "a", field "d"}
--DUPLICATE EXAMPLES
duplicate record 2
duplicate middle record
duplicate record 3 of window 2 to window 2
duplicate first menu item of menu "external"
--CREATE EXAMPLES
create record
create record at window 2
create record at first document
create record at database 2
create record with data "data"
create record at window 2 with data "test2"
create record at fir
st document with data "test3"
create record at database 2 with data "test4"
create record at database 2
create record with data {"more data", "abc"}
create record at window 2 with data {"test2", "abc"}
create record at first document with data {"test3", "abc"}
create record at database "a" with data {"test4", "abc"}
create menu with properties {name:"First Custom Menu", ID:123, enabled:false}
create menu item with properties {name:"First Custom Item", ID:321, enabled:true}
--DEL
ETE EXAMPLES
delete record 1
delete menu item 1 of menu "external"
--COUNT EXAMPLES
count records in database "test"
count layouts in database "test"
count cells in last window
end tell
Filemaker ProF
FMPRO AppleScript SyntaxH
6/14/96J
6/15/96P
ScriptY
Email Blaster (c) Mactivity, Inc. 1996
Email Blaster requires Eudora 2.1.1 or later
Written by Gary Stein (gary@mactivity.com)
on open (addresses)
set numMessages to 0
set badAddress to 0
set updateToSend to ""
if updateToSend = "" then
set updateToSend to (choose file with prompt "Please locate the text file with the update
set updateToSend to the result
end if
set subjectOfMessage to the text returned of (display dialog "What would you like me to put as the subject?" default answer "")
copy (open for access updateToSend) to fileRef
set updateToSend to (read fileRef to (get eof fileR
if the button returned of (display dialog "Do you want me to send all of these emails, or just queue them in your out box?" buttons {"send", "queue"} default button "queue") = "queue" then
repeat with currFile from 1 to (the number of items in addresses)
copy (open for access (item currFile of addresses)) to fileRefTwo
set addresslist to (read fileRefTwo as list using delimiters retur
tell application "Eudora Pro"
repeat with currAddress from 1 to the number of items in addresslist
set receiver to (item currAddress of addresslist)
if receiver does not contain "@" or receiver contains " " then
set badAddress to badAddress + 1
else
--thanks to Jon Wiederspan for everything from here
set newMessage to (make message at end of mailbox "out" of mail folder "")
set field "To" of newMessage to receiver
set field
"Subject" of newMessage to subjectOfMessage
set field "" of newMessage to updateToSend
queue newMessage
set numMessages to numMessages + 1
connect with sending
--
to here
end if
end repeat
end tell
end repeat
display dialog ("I'm all done! I sent " & numMessages & " emails. I found " & badAddress & " bad addresses (I didn't send anything to the bad addresses)")
quit
end if
on error
display dialog ("Error! I had a problem
ably the mail server or client couldn't connect. Please check that both are working. I sent out " & (numMessages + badAddress) & " email(s) before the problem occurred.")
end try
end open
on waitToSend(addresses, updateToSend, subjectOfMessage, numMessages, badAddress)
repeat with currFile from 1 to (the number of items in addresses)
copy (open for access (item currFile of addresses)) to fileRefTwo
set addresslist to (read fileRefTwo as list using delimiters return)
tell a
pplication "Eudora Pro"
repeat with currAddress from 1 to the number of items in addresslist
set receiver to (item currAddress of addresslist)
if receiver does not contain "@" or receiver contains " " then
set badAddress to badAddress + 1
else
set newMessage to (make message at end of mailbox "out" of mail folder "")
set field "To" of newMessage to receiver
set field "Subject" of newMessage to subjectOfMessage
set field "" of newMessage to u
pdateToSend
queue newMessage
set numMessages to numMessages + 1
end if
end repeat
end tell
end repeat
display dialog ("I'm all done! I queued " & numMessages & " emails. I found " & badAddress & " bad addresses (I didn't queue the bad addresses)")
quit
on error
display dialog ("Error! I had a problem
please check Eudora. I queued " & (numMessages + badAddress) & " email(s) before the problem occurred.")
end try
end waitToSend
on quit
continue quit
end quH
EudoraF
Eudora Email BlasterG
Gary Stein <gary@mactivity.com>H
6/14/96J
6/15/96P
Droplet
Email Blaster
written by Gary Stein (gary@mactivity.com)
(c) Mactivity, Inc. 1996
Email Blaster is a little AppleScript that we developed to help us send out a
electronic newsletter to a long list of email addresses. Here's how to use it:
Step #1: Write the message that you want to send out in SimpleText.
Step #2: Create a text file of email addresses where each address is on its own
line (most databases or spreadsheets can export data like this).
Step #3: Drag the e
mail address file onto the Email Blaster icon. You can drag
multiple email files. Email Blaster will take care of all of them.
Step #4: Answer the questions it asks. The first will be to locate the file
that contains the message you want to send out. The second will be for
the Subject of the message (actually, the first time you run this, it
will probably also ask you to locate Eudora). The last will be whether
you want to send each email as it is cr
eated, or just to queue them up
in your out box. If you are on a dial-up connection, or just a slow
connection to your mail server, you may want to just have the emails
queued up. When Email Blaster is done, you will need to connect up and
send the emails yourself.
Step #5: Sit back and watch Eudora do its thing. Emails will be created, placed
in the out box, then sent (if you chose "send"; if not, they will
just be placed in the out box)
. The script also checks each email address,
and will disregard any address that have a space in them or don't contain
an "@" symbol. When the script is done, you'll get a count of how many
addresses were bad, and how many total emails were sent. This script works
fine in the background. On my IIci it was taking about 5 seconds per message.
IMPORTANT NOTE ABOUT MEMORY!
----------------------------
Email Blaster was made to handle long email lists (about 7800 addr
esses). The
script works by reading in all of the addresses into a single variable. In
order to do this without running out of memory, you'll need to boost the memory
partition for Email Blaster in the "Get Info" box. You may need to experiment a
little with the best size for you.
REMEMBER:
--------
You have to have Apple's AppleScript System installed to have this thing work.
In addition to the AppleScript Extension, Email Blaster also uses the following
Scripting Additions:
Read/Writ
Display Dialog
Choose File
These are all part of the standard AppleScript release (like the one with
System 7.5).
Disclaimer:
----------
Mactivity, Inc. makes no guarantees for the use of this software. It has been
tested on our site and has proven to work. Your results may be different.
Mactivity, Inc. does not support this software, although problems can be
emailed directly to Gary Stein (gary@mactivity.com).
AzThere is a bug in the dictionary for BBEdit that won't take the "8-bit characters" parameter for the Zap Gremlins command.
tell application "BBEdit 4.0"
activate
--QUERY FOR HEADLINE TYPE
with timeout of 18000 seconds
repeat
display dialog "Enter the number:" & return &
tab & "1) Action Item" & return &
tab & "2) Job Offer" & return &
tab & "3) Joke" & return &
tab & "4) Press Release" & return &
tab & "5) Special Offer" & return &
tab & "6) Tidbit" default answer "6"
try
set theIndicator to text returned of result as number
if theIndicator is in {1, 2,
3, 4, 5, 6} then exit repeat
on error
end try
end repeat
end timeout
--This added routine will strip out any text from the first
--occurence of "---------- Headers -------------" to the end of the file
if (find "-- Headers --" with start at top without extend selection) is true then
set currentLineNumber to (startLine of selection)
select (lines currentLineNumber thru -1)
delete
end if
--REPLACE SOME OF THE INVSIBLE CHARACTERS
set theBetaCharacter to (ASCII charact
er 128)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 129)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 130)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 131)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set
theBetaCharacter to (ASCII character 132)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 133)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 134)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 135)
replace Every Occurrence searching for theBetaCharacter
using "
" with start at top
set theBetaCharacter to (ASCII character 136)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 137)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 138)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 139)
replace Every Occurre
nce searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 140)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 141)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 142)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII cha
racter 143)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 144)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 145)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 146)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 147)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 148)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 149)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 150)
replace Every Occurrence searching for theBetaChara
cter using "
" with start at top
set theBetaCharacter to (ASCII character 151)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 152)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 153)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 154)
replace Every Occ
urrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 155)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 156)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 157)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII
character 158)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 159)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 160)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 161)
replace Every Occurrence searching for theBetaCharacter using "
" with start at t
set theBetaCharacter to (ASCII character 162)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 163)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 164)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 165)
replace Every Occurrence searching for theBetaC
haracter using "
" with start at top
set theBetaCharacter to (ASCII character 166)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 167)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 168)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 169)
replace Every
Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 170)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 171)
replace Every Occurrence searching for theBetaCharacter using "" with start at top -- "
set theBetaCharacter to (ASCII character 172)
replace Every Occurrence searching for theBetaCharacter using "" with start at top -- "
set theBetaCha
racter to (ASCII character 173)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 174)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 175)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 176)
replace Every Occurrence searching for theBetaCharacter using "
with start at top
set theBetaCharacter to (ASCII character 177)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 178)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 179)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 180)
replace Every Occurrence search
ing for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 181)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 182)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 183)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 184
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 185)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 186)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 187)
replace Every Occurrence searching for theBetaCharacter using "" with start at top -- "
set
theBetaCharacter to (ASCII character 188)
replace Every Occurrence searching for theBetaCharacter using "" with start at top -- "
set theBetaCharacter to (ASCII character 189)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 190)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 191)
replace Every Occurrence searching for theBetaCha
racter using "
" with start at top
set theBetaCharacter to (ASCII character 192)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 193)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 194)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 195)
replace Every O
ccurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 196)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 198)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 199)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASC
II character 200)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 201)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 202)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 203)
replace Every Occurrence searching for theBetaCharacter using "
" with start at
set theBetaCharacter to (ASCII character 204)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 205)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 206)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 207)
replace Every Occurrence searching for theBet
aCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 208)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 209)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 210)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 211)
replace Eve
ry Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 212)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 213)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 214)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to
(ASCII character 215)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 216)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
set theBetaCharacter to (ASCII character 217)
replace Every Occurrence searching for theBetaCharacter using "
" with start at top
repeat with i from 218 to 255
set theBetaCharacter to (ASCII character i)
replace Every Occurrence searching for the
BetaCharacter using "" with start at top
end repeat
tell document 1
-- STEP 1) UNWRAP THE MULTIPLE-LINE PARAGRAPHS
repeat with i from 1 to the number of lines
try
if the length of line i > 60 then
go to line i with select line
event R*chSel
Paragraph
unwrap with selection only
end if
on error
exit repeat
end try
end repeat
-- STEP 2) REMOVE ALL "<" AND ">"
--reset the cursor to the start of the document
set selection start to 0
t selection end to 0
--Find and Change
replace Every Occurrence searching for "<" using ""
replace Every Occurrence searching for ">" using ""
-- STEP 3) STUPEFY QUOTES
--Find and Change
replace Every Occurrence searching for "
" using "\""
replace Every Occurrence searching for "
" using "\""
replace Every Occurrence searching for "
" using "'"
replace Every Occurrence searching for "
" using "'"
-- STEP 4) ZAP THE GREMLINS
--Make sure the options are set in
this dialog before running the script
--This command POSTS A DIALOG unless you check the "No Can't Undo Dialogs" checkbox in
--the Preferences dialog available in the Edit menu
--ATTEN: There is a bug in the scripting code for BBEDit that won't allow
--parameters for this command to be indicated
--make sure you have "Zap 8-bit characters" unchecked in the application dialog
zap gremlins --with controls and filter linefeeds
--STEP 5) REMOVE MULTIPLE SPACES
--Find and Ch
replace Every Occurrence searching for " " using " " -- 6 spaces
replace Every Occurrence searching for " " using " " -- 5 spaces
replace Every Occurrence searching for " " using " " -- 4 spaces
replace Every Occurrence searching for " " using " " -- 3 spaces
replace Every Occurrence searching for " " using " " -- 2 spaces
-- STEP 6) REMOVE LEADING SPACES
repeat with i from 1 to the number of lines
repeat
if character 1 of line i is " " then
set character 1 of line i to ""
else
exit repeat
end if
end repeat
end repeat
--PARSE THE TEXT FOR URLs, HTTPs, FTPs, and MAILTOs AND ENCASE THEM
set theTripWire to true
repeat with theSearchItem in {"@", "http://", "ftp://", "mailto://"}
set selection start to 0
set selection end to 0
repeat
--do a find
set theTripWire to (find theSearchItem with extend selection)
--look until no more occurences are found
if theTripWire is false then ex
it repeat
set offsetOfTheAtCharacter to selection end
--select only the @ character
set selection start to (offsetOfTheAtCharacter - 1)
--FIND THE END OF THE URL
repeat
--select the next character to the right
set theCurrentOffset to selection start
if theCurrentOffset is (count of characters) + 1 then --last character in the document
if last character is "." then -- last character of the document
delete last character
replace selection using ">."
else
replace selection using thisChar & ">"
end if
exit repeat
else
set selection end to (theCurrentOffset + 2)
set selection start to (theCurrentOffset + 1)
--copy the clipboard to a variable
set thisChar to selected text
--examine the character
if thisChar is " " then
replace selection using "> "
exit repeat
else if thisChar is return then -- in case the URL ends a li
replace selection using ">" & return
exit repeat
else if thisChar is "," then -- in case there is a comma delimited list of URLs
replace selection using ">,"
exit repeat
else if thisChar is ";" then -- in case there is a semi-colon delimited list of URLs
replace selection using ">;"
exit repeat
else if thisChar is ">" then -- to prevent double encasing
exit repeat
else if thisChar is ")" then -- to remove parens
replace selection using ">"
exit repeat
else if thisChar is "." then -- check for "end of line" periods
if character (theCurrentOffset + 2) is " " or
character (theCurrentOffset + 2) is return then
replace selection using ">."
exit repeat
end if
end if
end if
end repeat
--reset the selection back to the @ character
set selection start to (offsetOfTheAtCharacter - 1)
set selection end to offsetOfTheAtC
haracter
--FIND THE BEGINNING OF THE URL
repeat
--select the next character to the right
set theCurrentOffset to selection start
if theCurrentOffset is 1 then -- the first character of the document
replace selection using "<" & thisChar
else
set selection end to (theCurrentOffset)
set selection start to (theCurrentOffset - 1)
--copy the clipboard to a variable
set thisChar to selected text
--examine the chara
if thisChar is " " then
replace selection using " <"
exit repeat
else if thisChar is tab then -- in case the URL is after a tab
replace selection using " <"
exit repeat
else if thisChar is return then -- in case the URL starts a line following a line
replace selection using return & "<"
exit repeat
else if thisChar is "<" then -- to prevent double encasing
exit repeat
else if thisChar is "(" then -- to remo
ve parens
replace selection using "<"
exit repeat
end if
end if
end repeat
--reset the selection back to the @ character + 1 to continue the search
set selection start to offsetOfTheAtCharacter
set selection end to offsetOfTheAtCharacter + 1
end repeat
end repeat
-- STEP 7) INSERT HEADER TEXT
--RESET THE SELECTION TO THE TOP OF THE DOCUMENT
set selection start to 0
set selection end to 0
if theIndicator is 1 then
se
t theHeaderText to "This action item is from:" & return & return
else if theIndicator is 2 then
set theHeaderText to "This job offer is from:" & return & return
else if theIndicator is 3 then
set theHeaderText to "This joke is from:" & return & return
else if theIndicator is 4 then
set theHeaderText to "This press release is from:" & return & return
else if theIndicator is 5 then
set theHeaderText to "This special offer is from:" & return & return
else if theIndicatorh
is 6 then
set theHeaderText to "This tidbit is from:" & return & return
end if
insert text theHeaderText
end tell
end tell
beep 2
BBEdit 4.0F
s Mail Munger
Guy Kawasaki & Sal SoghoianH
6/14/96J
6/15/96P
Script
GUTM 1.0
An e-mail cleaner script for use with Claris Emailer and BBEdit 4.0.
By Guy Kawasaki and Sal Soghoian
Howdy! Thanks for downloading this script. We hope that you will find it both a useful tool and an informative example in the use of AppleScript. It can be a real timesaver if you convert email from the recieved version to a version suitable for inclusion in word processing, printing, or layouts.
The script will:
Create a custom header at the top of the "cleaned"
email file. It currently has options for Action Item, Job Offer, Joke, Press Release, Special Offer, and TIdbit, but these are easily editable and can be changed it the script by opening it into the script editor and making your alterations.
Strip out that blob of text at the end of an email message recieved from the Internet that starts with:
Replace an apporpriate "blank box" character with the beta ch
aracter (
Unwrap any multiple line paragraphs whose first line is more than 60 characters
Delete exisitng greater than (>), less than (<) characters
Stupefy quotes. In other words, make the curley quotes and apostrophes into inch/feet marks.
Remove control characters and filter line feeds
Remove globs of blank spaces
Remove leading spaces from lines of text
Encase all URLs in "<" ">", like: <http://users.aol.com/nyhthawk/welcome.html>
This includes those with an @ c
haracter and either beginning with "http://" or "ftp://" or "mailto://"
REQUIREMENTS
Firstly, you must have AppleScript installed and activated. The AppleScript extension must be in the Extensions folder in the System folder.
You may also want to have the Finder Scripting extension activated as well (if you use System 7.5 or higher), although it is not required to run this script. You'll find it useful for many other tasks to have your actions in the FInder recordable. If you choo
se to have it active, then it too must be in the Extensions folder in the System folder.
You must be using BBEdit version 4.0 or higher.
It has a new scripting dictionary that supports the scripting object model and is very powerful and useful.
Place GUTM in the BBEdit Scripts folder in the BBEdit folder. It will then become available under the BBEdit script menu.
Open the Preferences window from the Edit menu. Choose the Editor prefs from the scrolling list on the left. UNCHECK the b
ox called No
t Undo
Alerts.
There is a bug in version BBEdit 4.0 concerning setting some of the Zap Gremlin parameters that does not allow the script to set the parameters to required settings. You must instead set them once in the Zap Gremlins dialog which is accessed under the Text menu. UNCHECK the Zap 8-bit Characters box.
USING GUTM
Now you're ready to use the script!
While in the browser window for an email, choose select all and copy the mail to the clipb
Switch to BBEdit, create a new document and paste in the email
Run the script, and make you selection from the dialog
EPILOGUE
Well thanks for taking the time to read this. Enjoy your new script tool. If your interested in learning more about AppleScript or getting more free editable scripts, try Sal's website at:
http://users.aol.com/nyhthawk/welcome.html
Enjoy!
A~Click here to read me...
Clicking on the ReadMe button above will give you information about this database and how to use it.
The information found in the read me area will tell you more about how to use this database and who it will help.
General information about this screen.
When there is ReadMe information that accompanys the script code that would be in this area the ReadMe button will be active.
At the bottom of this screen you can select whether a copy of the current script will be taken to your script editor.
You can also mark your frequently used scripts with the Marked checkbox. ClicB
king the Script Editor button will launch Script Editor and clicking the ReadMe Text File button will take you to the area where you can enter ReadMe information. Note: any formating to text will not be saved upon export of your scripts.
General
Information about this database
G"Matt Petrowsky <maventure@aol.com>H
6/15/96J
6/15/96P
About this product...
(click in this area to read more.)
This database is a shell that serves as a repository for all of your AppleScript code and information.
Through a collaborative effort between yourself and the AppleScript community you can share your scripts with others as well as get scripts from other scripters. Under the Script Menu you will find both an Import and Export menu item for trading scripts using this database.
While in its infancy, there are many uses fo
r this model. To gain access to a large collection of AppleScript scripts there are many sources that you can check out.
<book, web site & scripting mailing list information coming here soon.>
If you have comments or suggestions for this growing database project then please send email to Matt Petrowsky <macventure@aol.com>. Please do not send requests for information about solving AppleScript problems.
If needed, this record contains the information about the export and imp
ort order of the fields in this database.
In the upper right hand corner you can see the picture of the export order of the fields.
I use tab-delimited to export in order to make things import/export nicely - comma delimited may get you in trouble if you don't know :-)
Drag a copy of the picture to the desktop to view it in full view. The picture holder is also an area where you can store PICT files that demonstrate things that are not self evident.
Enjoy!
Store your comments here.U
The objective of this script is to generate a single To: message from a FileMaker database. It will send the message to Claris Emailer.
--Working with the current showing record
--we set the information to variables
tell application "FileMaker Pro"
set subjectvar to get data cell named "Subject" of current record
set bodyvar to get data cell named "message" of current record
set addressvar to get data cell named "Internet Mail" of current record
set fname to get data cell named "First Name" of current record
set lname to get data cell named "Last Name" of current record
set fullname to fname & " " & lname as string
end tell
tell application "Claris Emailer 1.1v1"
create mail subject subjectvar body bodyvar recipients {name:fullname, address:addressvar, type:0} encoding 0 with save without compress
end tell
FileMaker ProF!Single Emailer Msg from FileMakerG
Matt PetrowskyH
6/14/96J
6/15/96P
Script
A-Click here then click ReadMe for more info...BHNotice that you can use colors to highlight differences in your scripts.D
General
Getting more scripts...
G#Matt Petrowsky <macventure@aol.com>H
6/15/96J
6/15/96P
Looking for more scripts?
If you are looking for more scripts than there are in this database then you are not alone. Finding scripts that help you learn, are the key to understanding the different dictionaries that applications support.
I personally offer a large collection of FileMaker Pro scripts as well as a few Emailer and Eudora scripts. There are other scripters that have other collections for other programs such as QuarkXpress. Rather than including them here (because not
everyone wants FileMaker Pro scripts) I will make them available the same way that you can make your scripts available.
I will post an exported file to a web site (depending on where it gets set up) that is called FileMaker AppleScripts. You can then download this file and import them into your database. (or you can just email me)
From within my copy of the AppleScript Database I can mark which scripts I want to export and then export them. I can then send them to you so that yo
1u will have all of the scripts that I have. When you get the file attachment (ususally a very small tab-delimited text file - when compressed) you select IMPORT from the script menu within your copy of the AppleScript Database. By using this method it becomes very easy to share scripts amongst scripters.
A4Useful for learning FileMaker AppleScript Properties
tell application "FileMaker Pro"
--MENU ITEM PROPERTIES
create menu item
class of first menu item of menu "File"
default type of first menu item of menu "File"
best type of first menu item of menu "File"
item number of menu item "New
" of menu "File"
checked of menu item "New
" of menu "File"
notify address of first menu item of menu "external"
--RECORD PROPERTIES
class of first record
best type of record 2
default type of record -3
ID of record 3
access of record 2 of da
tabase 2
protection of record 2 of document 2
lock of first record
--WINDOW PROPERTIES
class of window "Test1"
best type of window 2
default type of window -2
name of first window
bounds of window 1
visible of window 2
index of window 2
floating of window 2
zoomed of first window
zoomable of window 2
modal of window "Test1"
resizable of window 2
--MENU PROPERTIES
class of menu "File"
best type of menu "Select"
default type of menu "Scripts"
name of menu 2
ID of men
u "File"
enabled of menu "File"
--LAYOUT PROPERTIES
class of first layout of window 2
best type of first layout of window 2
default type of first layout of window 2
name of layout "layout #1"
ID of first layout
kind of layout 0
kind of first layout
access of layout 0
protection of layout 2
lock of first layout of window 2
--FIELD PROPERTIES
class of first field
best type of field "a"
default type of field -2
ID of first field
name of field 2
nulls OK of field 2
repe
ats of field "a"
repeat size of field "a"
unique value of field 2
access of field 2
protection of field -2
formula of field "a"
lock of last field
--DATABASE PROPERTIES
class of first database
best type of database -2
default type of database "Test1"
access of database 2
name of database 2
name of current layout of database 2
ID of current record of first database
lock of database 2
--CELL PROPERTIES
class of cell "a" of window "Test1"
best type of cell 2
default typ
e of last cell of last window
ID of last cell of last window
name of cell 2
protection of cell -2
formula of cell "c"
repeat size of cell 2
cellValue of cell 2
lock of cell 3
--SCRIPT PROPERTIES
class of first FileMaker script
best type of FileMaker script "a"
default type of FileMaker script "a"
name of FileMaker script "a"
ID of FileMaker script "a"
--DOCUMENT PROPERTIES
class of document "Test1"
best type of document 2
default type of document -2
name of document 1F'
modified of first document
end tell
Filemaker ProF
FMPRO AppleScript PropertiesH
6/15/96J
6/15/96P
ScriptY
Helvetica
Geneva
Times
Palatino
New York
Monaco
Courier
Show Description
Hide Description
A View List
ReadMe Button
Enter Read Me Text
Activate Script Editor
Sort by Script Name
Sort by Application
About...
Moreel
AppleScript Database by Matt Petrowsky
Email <macventure@aol.com>
Copyright
1996 - All rights reserved.
This database is freeware - public distribution permitted.B+